home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Subtraction / card_4741.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  11.5 KB  |  502 lines

  1. -- card: 4741 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4396
  5. -- name: 
  6.  
  7.  
  8. -- part 3 (button)
  9. -- low flags: 00
  10. -- high flags: 8003
  11. -- rect: left=354 top=102 right=139 bottom=468
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Next Problem
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if field "Flag" = 0 then exit mouseUp
  23.   show button "Smiley"
  24.   show button "Frowney"
  25.   put empty into field "Comment"
  26.   put "  " into field "Minuend"
  27.   put "  " into field "Subtrahend"
  28.   put empty into field "Difference"
  29.   if field "Attempts" = second word of bkgnd field "Options" then
  30.     put field "Attempts" into attempts
  31.     put field "Correct" into correct
  32.     put field "Percent" into percent
  33.     put field "Name" into name
  34.     put third word of field "Options" into skill
  35.     put "O" into field "Attempts"
  36.     put "O" into field "Correct"
  37.     put "O" into field "Percent"
  38.     set the lockScreen to true
  39.     set the cursor to 4
  40.     go to first card of bkgnd "Users"
  41.     rotateData
  42.     put name into line 1 of field "name"
  43.     put the date into line 1 of field "Date"
  44.     put skill into line 1 of field "Skill"
  45.     put attempts into line 1 of field "Attempts"
  46.     put correct into line 1 of field "Correct"
  47.     put percent into line 1 of field "Percent"
  48.     pop card
  49.     exit mouseUp
  50.   end if
  51.   put "  " into num2
  52.   get the random of 80
  53.   add 9 to it
  54.   put it into num1
  55.   put 9 into it
  56.   subtract second char of num1 from it
  57.   if it>2 then get the random of it else put 1 into it
  58.   subtract 1 from it
  59.   put it into second char of num2
  60.   put 8 into it
  61.   subtract first char of num1 from it
  62.   if it>2 then get the random of it else put 1 into it
  63.   put it into first char of num2
  64.   put num1 into num3
  65.   add num2 to num3
  66.   put "   " into field "Difference"
  67.   put "0" into field "Flag"
  68.   put "?" into char 3 of field "Difference"
  69.   put num3 into field "Minuend"
  70.   put num2 into field "Subtrahend"
  71. end mouseUp
  72.  
  73. on rotateData
  74.   repeat with x = 11 down to 1
  75.     if line x of field "Name" is empty then next repeat
  76.     put x into nextLine
  77.     add 1 to nextLine
  78.     get line x of field "Name"
  79.     put it into line nextLine of field "Name"
  80.     get line x of field "Date"
  81.     put it into line nextLine of field "Date"
  82.     get line x of field "Skill"
  83.     put it into line nextLine of field "Skill"
  84.     get line x of field "Attempts"
  85.     put it into line nextLine of field "Attempts"
  86.     get line x of field "Correct"
  87.     put it into line nextLine of field "Correct"
  88.     get line x of field "Percent"
  89.     put it into line nextLine of field "Percent"
  90.   end repeat
  91. end rotateData
  92.  
  93.  
  94.  
  95.  
  96. -- part 4 (button)
  97. -- low flags: 00
  98. -- high flags: 8003
  99. -- rect: left=355 top=161 right=194 bottom=388
  100. -- title width / last selected line: 0
  101. -- icon id / first selected line: 0 / 0
  102. -- text alignment: 1
  103. -- font id: 0
  104. -- text size: 12
  105. -- style flags: 0
  106. -- line height: 16
  107. -- part name: 7
  108. ----- HyperTalk script -----
  109. on mouseUp
  110.   repeat with x=3 down to 2
  111.     if char x of field "Difference" is "?" then
  112.       put "7" into char x of field "Difference"
  113.       put x into it
  114.       subtract 1 from it
  115.       if  x>2 then put "?" into char it of field "Difference"
  116.       exit mouseUp
  117.     end if
  118.   end repeat
  119. end mouseUp
  120.  
  121.  
  122.  
  123. -- part 5 (button)
  124. -- low flags: 00
  125. -- high flags: 8003
  126. -- rect: left=395 top=161 right=194 bottom=427
  127. -- title width / last selected line: 0
  128. -- icon id / first selected line: 0 / 0
  129. -- text alignment: 1
  130. -- font id: 0
  131. -- text size: 12
  132. -- style flags: 0
  133. -- line height: 16
  134. -- part name: 8
  135. ----- HyperTalk script -----
  136. on mouseUp
  137.   repeat with x=3 down to 2
  138.     if char x of field "Difference" is "?" then
  139.       put "8" into char x of field "Difference"
  140.       put x into it
  141.       subtract 1 from it
  142.       if  x>2 then put "?" into char it of field "Difference"
  143.       exit mouseUp
  144.     end if
  145.   end repeat
  146. end mouseUp
  147.  
  148.  
  149.  
  150. -- part 6 (button)
  151. -- low flags: 00
  152. -- high flags: 8003
  153. -- rect: left=435 top=162 right=194 bottom=467
  154. -- title width / last selected line: 0
  155. -- icon id / first selected line: 0 / 0
  156. -- text alignment: 1
  157. -- font id: 0
  158. -- text size: 12
  159. -- style flags: 0
  160. -- line height: 16
  161. -- part name: 9
  162. ----- HyperTalk script -----
  163. on mouseUp
  164.   repeat with x=3 down to 2
  165.     if char x of field "Difference" is "?" then
  166.       put "9" into char x of field "Difference"
  167.       put x into it
  168.       subtract 1 from it
  169.       if  x>2 then put "?" into char it of field "Difference"
  170.       exit mouseUp
  171.     end if
  172.   end repeat
  173. end mouseUp
  174.  
  175.  
  176.  
  177. -- part 7 (button)
  178. -- low flags: 00
  179. -- high flags: 8003
  180. -- rect: left=356 top=201 right=233 bottom=389
  181. -- title width / last selected line: 0
  182. -- icon id / first selected line: 0 / 0
  183. -- text alignment: 1
  184. -- font id: 0
  185. -- text size: 12
  186. -- style flags: 0
  187. -- line height: 16
  188. -- part name: 4
  189. ----- HyperTalk script -----
  190. on mouseUp
  191.   repeat with x=3 down to 2
  192.     if char x of field "Difference" is "?" then
  193.       put "4" into char x of field "Difference"
  194.       put x into it
  195.       subtract 1 from it
  196.       if  x>2 then put "?" into char it of field "Difference"
  197.       exit mouseUp
  198.     end if
  199.   end repeat
  200. end mouseUp
  201.  
  202.  
  203.  
  204. -- part 8 (button)
  205. -- low flags: 00
  206. -- high flags: 8003
  207. -- rect: left=395 top=202 right=234 bottom=428
  208. -- title width / last selected line: 0
  209. -- icon id / first selected line: 0 / 0
  210. -- text alignment: 1
  211. -- font id: 0
  212. -- text size: 12
  213. -- style flags: 0
  214. -- line height: 16
  215. -- part name: 5
  216. ----- HyperTalk script -----
  217. on mouseUp
  218.   repeat with x=3 down to 2
  219.     if char x of field "Difference" is "?" then
  220.       put "5" into char x of field "Difference"
  221.       put x into it
  222.       subtract 1 from it
  223.       if  x>2 then put "?" into char it of field "Difference"
  224.       exit mouseUp
  225.     end if
  226.   end repeat
  227. end mouseUp
  228.  
  229.  
  230.  
  231. -- part 9 (button)
  232. -- low flags: 00
  233. -- high flags: 8003
  234. -- rect: left=435 top=201 right=233 bottom=466
  235. -- title width / last selected line: 0
  236. -- icon id / first selected line: 0 / 0
  237. -- text alignment: 1
  238. -- font id: 0
  239. -- text size: 12
  240. -- style flags: 0
  241. -- line height: 16
  242. -- part name: 6
  243. ----- HyperTalk script -----
  244. on mouseUp
  245.   repeat with x=3 down to 2
  246.     if char x of field "Difference" is "?" then
  247.       put "6" into char x of field "Difference"
  248.       put x into it
  249.       subtract 1 from it
  250.       if  x>2 then put "?" into char it of field "Difference"
  251.       exit mouseUp
  252.     end if
  253.   end repeat
  254. end mouseUp
  255.  
  256.  
  257.  
  258. -- part 10 (button)
  259. -- low flags: 00
  260. -- high flags: 8003
  261. -- rect: left=356 top=242 right=274 bottom=389
  262. -- title width / last selected line: 0
  263. -- icon id / first selected line: 0 / 0
  264. -- text alignment: 1
  265. -- font id: 0
  266. -- text size: 12
  267. -- style flags: 0
  268. -- line height: 16
  269. -- part name: 1
  270. ----- HyperTalk script -----
  271. on mouseUp
  272.   repeat with x=3 down to 2
  273.     if char x of field "Difference" is "?" then
  274.       put "1" into char x of field "Difference"
  275.       put x into it
  276.       subtract 1 from it
  277.       if  x>2 then put "?" into char it of field "Difference"
  278.       exit mouseUp
  279.     end if
  280.   end repeat
  281. end mouseUp
  282.  
  283.  
  284.  
  285. -- part 11 (button)
  286. -- low flags: 00
  287. -- high flags: 8003
  288. -- rect: left=395 top=241 right=273 bottom=428
  289. -- title width / last selected line: 0
  290. -- icon id / first selected line: 0 / 0
  291. -- text alignment: 1
  292. -- font id: 0
  293. -- text size: 12
  294. -- style flags: 0
  295. -- line height: 16
  296. -- part name: 2
  297. ----- HyperTalk script -----
  298. on mouseUp
  299.   repeat with x=3 down to 2
  300.     if char x of field "Difference" is "?" then
  301.       put "2" into char x of field "Difference"
  302.       put x into it
  303.       subtract 1 from it
  304.       if  x>2 then put "?" into char it of field "Difference"
  305.       exit mouseUp
  306.     end if
  307.   end repeat
  308. end mouseUp
  309.  
  310.  
  311.  
  312. -- part 12 (button)
  313. -- low flags: 00
  314. -- high flags: 8003
  315. -- rect: left=436 top=242 right=274 bottom=468
  316. -- title width / last selected line: 0
  317. -- icon id / first selected line: 0 / 0
  318. -- text alignment: 1
  319. -- font id: 0
  320. -- text size: 12
  321. -- style flags: 0
  322. -- line height: 16
  323. -- part name: 3
  324. ----- HyperTalk script -----
  325. on mouseUp
  326.   repeat with x=3 down to 2
  327.     if char x of field "Difference" is "?" then
  328.       put "3" into char x of field "Difference"
  329.       put x into it
  330.       subtract 1 from it
  331.       if  x>2 then put "?" into char it of field "Difference"
  332.       exit mouseUp
  333.     end if
  334.   end repeat
  335. end mouseUp
  336.  
  337.  
  338.  
  339. -- part 13 (button)
  340. -- low flags: 00
  341. -- high flags: 8003
  342. -- rect: left=355 top=281 right=313 bottom=407
  343. -- title width / last selected line: 0
  344. -- icon id / first selected line: 0 / 0
  345. -- text alignment: 1
  346. -- font id: 0
  347. -- text size: 12
  348. -- style flags: 0
  349. -- line height: 16
  350. -- part name: 0
  351. ----- HyperTalk script -----
  352. on mouseUp
  353.   repeat with x=3 down to 2
  354.     if char x of field "Difference" is "?" then
  355.       put "0" into char x of field "Difference"
  356.       put x into it
  357.       subtract 1 from it
  358.       if  x>2 then put "?" into char it of field "Difference"
  359.       exit mouseUp
  360.     end if
  361.   end repeat
  362. end mouseUp
  363.  
  364.  
  365.  
  366. -- part 14 (button)
  367. -- low flags: 00
  368. -- high flags: 8003
  369. -- rect: left=414 top=281 right=313 bottom=468
  370. -- title width / last selected line: 0
  371. -- icon id / first selected line: 0 / 0
  372. -- text alignment: 1
  373. -- font id: 0
  374. -- text size: 12
  375. -- style flags: 0
  376. -- line height: 16
  377. -- part name: Enter
  378. ----- HyperTalk script -----
  379. on mouseUp
  380.   global answer
  381.   if field "Difference" < 1 then exit mouseUp
  382.   if field "Flag" > 0 then exit mouseUp
  383.   put field "Minuend" into answer
  384.   subtract field "Subtrahend" from answer
  385.   add 1 to field "Attempts"
  386.   if field "Difference" = answer then
  387.     add 1 to field "Correct"
  388.     get field "Correct"
  389.     divide it by field "Attempts"
  390.     multiply it by 100
  391.     put round(it) into field "Percent"
  392.     celebrate
  393.   else
  394.     get field "Correct"
  395.     divide it by field "Attempts"
  396.     multiply it by 100
  397.     put round(it) into field "Percent"
  398.     nag
  399.   end if
  400. end mouseUp
  401.  
  402. on celebrate
  403.   put "Correct" into line 1 of field "Comment"
  404.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  405.   hide button "Smiley"
  406.   put "1" into field "Flag"
  407.   if first word of bkgnd field "Options" = "Y" then
  408.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  409.   end if
  410. end celebrate
  411.  
  412. on nag
  413.   global answer
  414.   put "WRONG!" into line 1 of field "Comment"
  415.   put "The answer is "& answer & "." into line 3 of field "Comment"
  416.   hide button "Frowney"
  417.   put "2" into field "Flag"
  418.   if first word of bkgnd field "Options" = "Y" then
  419.     play "boing" tempo 200 "gq c e a"
  420.   end if
  421. end nag
  422.  
  423.  
  424.  
  425. -- part 15 (button)
  426. -- low flags: 00
  427. -- high flags: 0001
  428. -- rect: left=251 top=87 right=180 bottom=351
  429. -- title width / last selected line: 0
  430. -- icon id / first selected line: 0 / 0
  431. -- text alignment: 1
  432. -- font id: 0
  433. -- text size: 12
  434. -- style flags: 0
  435. -- line height: 16
  436. -- part name: Frowney
  437.  
  438.  
  439. -- part 16 (button)
  440. -- low flags: 00
  441. -- high flags: 0001
  442. -- rect: left=14 top=87 right=178 bottom=110
  443. -- title width / last selected line: 0
  444. -- icon id / first selected line: 0 / 0
  445. -- text alignment: 1
  446. -- font id: 0
  447. -- text size: 12
  448. -- style flags: 0
  449. -- line height: 16
  450. -- part name: Smiley
  451.  
  452.  
  453. -- part 17 (button)
  454. -- low flags: 00
  455. -- high flags: 8003
  456. -- rect: left=3 top=306 right=338 bottom=67
  457. -- title width / last selected line: 0
  458. -- icon id / first selected line: 0 / 0
  459. -- text alignment: 1
  460. -- font id: 0
  461. -- text size: 12
  462. -- style flags: 0
  463. -- line height: 16
  464. -- part name: Quit
  465. ----- HyperTalk script -----
  466. on mouseUp
  467.   go to first card
  468. end mouseUp
  469.  
  470.  
  471.  
  472. -- part contents for background part 1
  473. ----- text -----
  474. O
  475.  
  476. -- part contents for background part 2
  477. ----- text -----
  478. O
  479.  
  480. -- part contents for background part 3
  481. ----- text -----
  482. O
  483.  
  484. -- part contents for background part 4
  485. ----- text -----
  486.   
  487.  
  488. -- part contents for background part 5
  489. ----- text -----
  490.   
  491.  
  492. -- part contents for background part 8
  493. ----- text -----
  494. 1
  495.  
  496. -- part contents for background part 9
  497. ----- text -----
  498. Y 10 3
  499.  
  500. -- part contents for background part 10
  501. ----- text -----
  502. Larry